package com.hl.hello;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.time.LocalDate;

public class MainApp {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("BeanExam.xml");
        HelloWorld obj = (HelloWorld) context.getBean("helloWorld");
        obj.getMessage();
        
        ApplicationContext context1 = new ClassPathXmlApplicationContext(new String[]{"Beans.xml","BeanExam.xml"});
        HelloWorld helloWorld = context1.getBean("helloWorld", HelloWorld.class);
        helloWorld.getMessage();
        HuaWeiPhone huaWeiPhone1 = context1.getBean("huaWeiPhone", HuaWeiPhone.class);
        huaWeiPhone1.getName();
    
        LocalDate localDate = context1.getBean("localDate", java.time.LocalDate.class);
        System.out.println("localDate = " + localDate);
    }
    
}
